#ifndef __LIB_GUI_PROGRESS_H
#define __LIB_GUI_PROGRESS_H,,

#include<stddef.h>
#include"gui_spirit.h"
#include"gui_label.h"

typedef enum 
{
    GUI_PROGRESS_LEFT_TO_RIGHT, //from left to right
    GUI_PROGRESS_RIGHT_TO_LEFT, //from right to left
    GUI_PROGRESS_BOTTOM_TO_TOP, //from bottom to top
    GUI_PROGRESS_TOP_TO_BOTTOM, //from top to bottom
}gui_progress_bar_orientation_t;

typedef struct 
{
    gui_spirit_t spirit;
    gui_progress_bar_orientation_t orientation;
    gui_color_t front_color;
    double fraction;
    double step;
}gui_progress_bar_t;

#define GUI_PROGRESS_BAR(spirit) ((gui_progress_bar_t*)(spirit))

#define GUI_PBAR_BACK_COLOR GUI_RGB(192,192,192)
#define GUI_PBAR_BAR_COLOR GUI_RGB(128,128,128)

#define GUI_PBAR_WIDTH_DEFAULT 100
#define GUI_PBAR_HEIGHT_DEFAULT 20

gui_spirit_t *gui_progress_bar_create();
double gui_progress_bar_get_fraction(gui_progress_bar_t *pbar);
gui_progress_bar_orientation_t gui_progress_bar_get_orientation(gui_progress_bar_t *pbar);
void gui_progress_bar_pulse(gui_progress_bar_t *pbar);
void gui_progress_bar_set_pulse(gui_progress_bar_t *pbar,double step);
double gui_progress_bar_get_pulse_step(gui_progress_bar_t *pbar);
void gui_progress_bar_set_text(gui_progress_bar_t *pbar,char *text);
const char *gui_progress_bar_get_text(gui_progress_bar_t *pbar);
void gui_progress_bar_set_orientation(gui_progress_bar_t *pbar, uint32_t type);

#endif 